<!-- [title]开始 -->
<h4><if condition="$recordcount gt 0"><span class="r" style="margin-right:20px;"><a href="{:U('Comment/showlist?mdname='.$modname.'&id='.$data[id], '', C('URLREWRITE'), false, true)}">More...</a></span></if>我要[title]</h4>
<div class="consultation">
	<form method="post" id="commentform" action=""> 
	<div class="required">
     <label for="guest">姓名：</label><input type="text" value="" maxlength="100" size="10" class="inputText comment_nickname" name="nickname">		
     <label for="guest">电话：</label><input type="text" value="" maxlength="100" size="10" class="inputText" name="tel">
     <label for="guest">邮箱：</label><input type="text" value="" maxlength="100" size="10" class="inputText" name="email">     
  </div>
	<div class="required">
     <label for="guest">主题：</label><input type="text" value="" maxlength="100" size="50" class="inputText comment_title" style="width:480px;" name="title">
     <span>*</span>
  </div>   
  <div class="required">
     <label for="msg">内容：</label><textarea class="comment_contents" name="contents"></textarea>
     <input name="modid" type="hidden" value="{$data.id}">
     <input name="status" type="hidden" value="{$Think.config.comment_check}">
     <input name="sort" type="hidden" value="0">
     <input name="module" type="hidden" value="{$modname}">
     <input name="moduletitle" type="hidden" value="[title]">
     <input name="ajax" type="hidden" value="1">
  </div>
  <div class="vcode">
     <div class="r">
     		<div class="l" style="width:150px;margin-top:0px;"><span id="comment_tips"></span></div>
     		<input type="button" onclick="commentsubmit();" value="提交"  class="inputSubmit" /> 
     </div>
     <label for="captcha">验证码：</label><input type="text" id="verifyinput" value="" maxlength="25" class="inputText" name="verify">
     <img class="verifyImg" onclick="fleshVerify()" style="cursor:pointer; margin-top:-11px;" alt="点击更换验证码" src="{:U('Comment/verify', '', C('URLREWRITE'), false, true)}">
  </div>
  
  </form>
  <div class="consul guest">
     <div class="item_intro"><h4><if condition="$recordcount gt 0"><span class="r" style="margin-right:20px;"><a href="{:U('Comment/showlist?mdname='.$modname.'&id='.$data[id], '', C('URLREWRITE'), false, true)}">More...</a></span></if>【[subject]】共有 {$recordcount} 人[title]</h4></div>
     <DIV class="commentlistTable">
     <volist name="list" id="vo">
     	<div class="tblist">                                      
         <table width="100%" summary="[title]列表">
         <thead><tr><th colspan="2"><span class="r"><I>At {$vo.create_time|date='Y-m-d H:i', ###} <if condition="$vo[nickname]"> By {$vo.nickname}</if></I></span><h2>{$vo.title}</h2></th></tr></thead>
         <tbody><tr><th>[title]内容：</th><td>{$vo.contents}</td></tr></tbody></table>
      </div>
    </volist>
  </DIV>
  </div>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--

function fleshVerify(type){
	//重载验证码
	var timenow = new Date().getTime();
	if (type)
	{
		jQuery('.verifyImg').attr("src", "{:U('Comment/verify?adv=1', '', C('URLREWRITE'), false, true)}?"+timenow);
	}else{
		jQuery('.verifyImg').attr("src", "{:U('Comment/verify', '', C('URLREWRITE'), false, true)}?"+timenow);
	}
}

function commentsubmit(){
	sendForm("commentform", "{:U('Comment/insert', '', C('URLREWRITE'), false, true)}", commentHandle, "comment_tips");
}

function sendForm(formId,action,response,target,effect){
	// Ajax方式提交表单
	if (CheckForm($(formId),'ThinkAjaxResult'))//表单数据验证
	{
		ThinkAjax.sendForm(formId,action,response,target);
	}
}

function commentHandle(data,status){
	if (status==1)
	{
		appendComment();
		jQuery('#commentform')[0].reset();
	}	
}

function appendComment(){
	 var nickname = "";
	 var title = jQuery(".comment_title").val();
	 var contents = jQuery(".comment_contents").val();
	 var commentTime = CurentTime();
	 if(jQuery(".comment_nickname").val() != '')nickname = ' By '+jQuery(".comment_nickname").val();
	 var commentHtml = '<div class="tblist"><table width="100%" summary="[title]列表"><thead><tr><th colspan="2"><span class="r"><I>At '+commentTime+' '+nickname+'</I></span><h2>'+title+'</h2></th></tr></thead><tbody><tr><th>[title]内容：</th><td>'+contents+'</td></tr></tbody></table></div>';
	 var commentHtml = commentHtml + jQuery(".commentlistTable").html();
	 jQuery(".commentlistTable").html('');
	 jQuery(".commentlistTable").append(commentHtml);
	 <if condition="$Think.config.comment_check eq 0">alert("您的[title]需要审核后才能显示！");</if>
	 
}

function CurentTime()
{
		var now = new Date();
		var year = now.getFullYear();
		var month = now.getMonth() + 1;
		var day = now.getDate();
		var hh = now.getHours();
		var mm = now.getMinutes();
		var clock = year + "-";
		if(month < 10)clock += "0";
		clock += month + "-";
		if(day < 10)clock += "0";
		clock += day + " ";
		if(hh < 10)clock += "0";
		clock += hh + ":";
		if (mm < 10) clock += '0'; 
		clock += mm; 
		return(clock);
}

//-->
</SCRIPT>
<!-- [title]结束 -->